package com.naiterui.ehp.bs.b2c.product.repository;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import com.naiterui.common.repository.core.BaseJpaRepository;
import com.naiterui.ehp.bs.b2c.product.entity.Category;

/**
 * 商品分类ORM层
 */
@Repository
public interface ICategoryRepository extends BaseJpaRepository<Category, Long> {

    @Query("select c from Category c where c.parentId = 0")
    List<Category> findPrimaryCategory();

    @Query("select c from Category c where c.parentId <> 0")
    List<Category> findSecondCategory();
}
